<?
require("config.php");


if (NULL!=$action){

	if ($Picture_name=="" || $Picture_name==NULL) $Picture_name=$old_Picture;

	if ($Password1=="") $Password1=$old_Password;

   $field = array(
	"name",
	"email",
	"password", 
	);


   $content = array(
	$Name,
	$Email,
	$Password1,
	);

	$exp = "id='$Id'";

   myUpdate($table,$field,$content,$exp);


   header("location:" . $rela_path . "share/msg.php?v=52");

   exit();

}


$Query = "SELECT 
name,
email,
password,
id 
FROM $table where username = '$admin_username'";

$r=myQuery($Query);

$Name=$r[0][0];
$Email=$r[0][1];
$Password=$r[0][2];
$Id = $r[0][3];

require($rela_path . "inc/header.php");

?>

<script language="JavaScript" type="text/JavaScript">
<!--

function checkinput(theform){

	if ((theform.Password1.value != "") && (theform.Password1.value !== theform.Password2.value)){ 
		msg = "Retype Password should be the same as New Password. \nPlease try again.";
		window.alert (msg);
		theform.Password1.focus();
		return false;
		}
}

//-->
</script>
<form action="" method="post" name="form1" onSubmit="return checkinput(this);">
<input name="action" type="hidden" value="edit">
<input name="Id" type="hidden" value="<?print($Id)?>">
<input name="old_Password" type="hidden" value="<?print($Password)?>">


<table width="95%" border="0" align="center">
  <tr> 
    <td valign="top"> <div align="right"><br>
      </div>
      <table border="0" cellspacing="0" cellpadding="2">
        <tr> 
          <td width="137" height="3" class="tdheader">Name :</td>
          <td width="455" height="3"> <input type="text" class="text" name="Name" size="40" value="<?print($Name)?>"> 
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">Email :</td>
          <td width="455"> <input type="text" class="text" name="Email" size="40"  value="<?print($Email)?>"> 
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">New Password :</td>
          <td width="455"> <input type="password" class="text" name="Password1"> 
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">Retype Password : </td>
          <td width="455"> <input type="password" class="text" name="Password2"> 
          </td>
        </tr>
        <tr> 
          <td width="137">&nbsp;</td>
          <td width="455">
<input type="image" src="../images/bt_cancel.gif" onClick="form1.reset();return false;"> <input type="image" src="../images/bt_save.gif">
            </td>
        </tr>
      </table></td>
  </tr>
</table>
<br>
<br>
<br>
</form>
<?
require($rela_path . "inc/footer.php");
?>
